package com.hxgis.common.config.cimiss;


import com.hxgis.cmiss.config.CimissHttpConfig;
import com.hxgis.cmiss.http.CimissHttpRequest;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Configuration
@Component
public class CimissBeanLoad {

    @Bean
    @ConfigurationProperties(prefix = "cimiss")
    public CimissHttpConfig getCimissHttpConfig(){
        return new CimissHttpConfig();
    }


    @Bean
    @Order(Integer.MIN_VALUE)
    public CimissHttpRequest getCimissHttpRequest(CimissHttpConfig httpConfig){
        return CimissHttpRequest.getInstance(httpConfig);
    }

}
